package com.ssm.hj.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.Search;
import com.ssm.hj.service.MouldService;
import com.ssm.hj.view.MouldView;
import com.ssm.pojo.Mould;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MouldController {
    @Resource
    private MouldService mouldService;

    @RequestMapping("/hj/queryMouldAll")
    public PageInfo<Mould> queryMouldAll(@RequestBody Page<Search> page) throws Exception{
        return this.mouldService.queryMouldAllService(page);
    }
    @RequestMapping("/hj/saveMould")
    public int saveMould(@RequestBody MouldView mouldView) throws Exception {
        return this.mouldService.saveMouldService(mouldView);
    }
}
